home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 5_6.lha / 5_6 / 5_6test.c < prev    next >
Text File  |  1993-08-08  |  473b  |  28 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include "char_queue.h"
  6. include <stream.h>
  7.  
  8. har array[] = "this is a test";
  9.  
  10. ain()
  11.  
  12.    char_queue c(100);
  13.    
  14.    for (char *a = array; *a; a++)
  15.        {
  16. char x = *a;
  17. cout << "adding " << chr(x) << "\n";
  18.        c.enqueue(x);
  19. }
  20.  
  21.    while (!c.emptyQ())
  22.        {
  23. char x = c.dequeue();
  24. cout << "got " << chr(x) << "\n";
  25. }
  26.    return 0;
  27.  
  28.